import { lazy } from "react";
import {Navigate} from "react-router-dom"

const Home=lazy(()=>import('../pages/Home/Home'))
const List=lazy(()=>import('../pages/List/List'))
const Data1=lazy(()=>import('../pages/Data1/Data1'))
const Data2=lazy(()=>import('../pages/Data2/Data2'))
const Mages=lazy(()=>import('../pages/Mages/Mages'))

export const routes=([
    {
        path:'/mages/home',
        element:<Home></Home>,
        title:'主页面',
        
    },
    {
        path:'/mages/list',
        element:<List></List>,
        title:'列表页'
    },
    {
        path:'/mages/data1',
        element:<Data1></Data1>,
        title:'数据1',
    },
    {
        path:'/mages/data2',
        element:<Data2></Data2>,
        title:'数据2'
    },
])

const listData=([
    {
        path:'',
        element:<Navigate to={'/mages'}></Navigate>
    },
    {
        path:'/mages',
        element:<Mages></Mages>,
        children:routes
    }
])
export default listData
